
export ARCH=arm
export CROSS_COMPILE=aarch64-linux-gnu-


uboot:
	cd u-boot-2017.09 && ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-  make rpi_3_defconfig  
	cd u-boot-2017.09 && ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-  make all  -j22  

xbisor_build:
	# cd xvisor && ARCH=arm CROSS_COMPILE=aarch64-linux-gnu-  make generic-v8-defconfig 
	# cd xvisor && ARCH=arm CROSS_COMPILE=aarch64-linux-gnu-  make -j22
	# cd xvisor && mkimage -A arm64 -O linux -T kernel -C none -a 0x00080000 -e 0x00080000 -n Xvisor -d build/vmm.bin build/uvmm.bin  
	# cd xvisor && make ARCH=arm dtbs
	cd xvisor && make -C tests/arm64/virt-v8/basic

krn_config:
	cd krn && cp arch/arm64/configs/defconfig arch/arm64/configs/tmp-virt-v8_defconfig  
	cd krn && ../xvisor/tests/common/scripts/update-linux-defconfig.sh \
		-p arch/arm64/configs/tmp-virt-v8_defconfig -f ../xvisor/tests/arm64/virt-v8/linux/linux_extra.config  

krn_build:
	cd krn && make ARCH=arm64 tmp-virt-v8_defconfig  
	cd krn && make ARCH=arm64 Image dtbs  -j22

.PHONY: uboot xvisor_build krn_config krn_build busybox
busybox:
	# ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-  make defconfig  
	# CONFIG_STATIC 
	# ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-  make menuconfig


xvisor_build:


run:
	/home/edgarzhou/work2/gitee/qemu_dev/qemu-10.2/build/qemu-system-aarch64 \
    -M virt,gic-version=3,its=on,iommu=smmuv3 -m 1G -sd 1.img \
    -serial stdio -nographic -monitor none

run:
	qemu-system-arm \
    -M vexpress-a9 -m 1G -sd 1.img \
    -serial stdio -nographic -monitor none

